Update docker.sh to add a check for existing image before building#17
Update docker.sh to add a check for existing image before building#17tianlelyd wants to merge 7 commits intoykdojo:masterfrom
Conversation
tianlelyd
commented
Jun 24, 2023
- Updated docker.sh to use the modification timestamp of Dockerfile to determine if the image needs to be rebuilt.
- Added .last_build_timestamp to .gitignore with a comment explaining why it should be ignored.
- Added a check to see if the Docker image already exists before building it. This is to optimize the script by avoiding unnecessary image builds, which can be time-consuming, and directly using the existing image if it's already available.
- Updated docker.sh to use the modification timestamp of Dockerfile to determine if the image needs to be rebuilt. - Added .last_build_timestamp to .gitignore with a comment explaining why it should be ignored.
|
Can you explain what the timestamp is for exactly? |
|
use the modification timestamp of Dockerfile to determine if the image needs to be rebuilt. |
|
Shouldn’t it use an inequality sign instead then?
…On Sat, Jun 24, 2023 at 4:37 PM Liyd ***@***.***> wrote:
use the modification timestamp of Dockerfile to determine if the image
needs to be rebuilt.
If the Dockerfile file is modified, rebuild the image, and if not, use the
image that has already been built
—
Reply to this email directly, view it on GitHub
<#17 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN2JQ2IT7CAPGUKUE47A53XM522LANCNFSM6AAAAAAZSM62ZA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
I meant > or < instead of != |
My previous idea was to rebuild the image as soon as the Dockerfile file was modified, but in fact, whenever the file is modified, the modification time is usually greater than the previous timestamp! So using '>' may be more accurate |
|
Your project reminds me of an idea I had - maybe we could collaborate? |
|
@tweyew436 can you describe it and put it in an appropriate place? |
- Changed the timestamp comparison in docker.sh to use greater than operator for clarity and to avoid unnecessary builds.
|
It looks good to me although I'd ideally like input from someone else. So I'll leave this open for now until we get someone else to take a look, hopefully |
|
ok |
…conflicts with other services 🐛 fix(ai-plugin.json): update the API URL to use the new exposed port 9999 instead of 3000 🐛 fix(openapi.yaml): update the server URL to use the new exposed port 9999 instead of 3000


